]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
polkit-agent: Remove hack to focus password entry
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 15 Sep 2011 12:04:15 +0000 (14:04 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Mon, 19 Sep 2011 19:26:32 +0000 (21:26 +0200)
As dialog buttons used to "steal" the initial key focus, the polkit
dialog delayed focusing the password entry. With buttons no longer
overwriting the manually set focus, this is no longer necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=659133

js/ui/polkitAuthenticationAgent.js

index 8ab7e480ced9dd6dfc360af27d84f2144e42a7b8..f5b027b7060fe0c977baabc5b703858d52fa3021 100644 (file)
@@ -142,6 +142,7 @@ AuthenticationDialog.prototype = {
         this._passwordEntry.clutter_text.connect('activate', Lang.bind(this, this._onEntryActivate));
         this._passwordBox.add(this._passwordEntry,
                               {expand: true });
+        this.setInitialKeyFocus(this._passwordEntry);
         this._passwordBox.hide();
 
         this._errorMessageLabel = new St.Label({ style_class: 'polkit-dialog-error-label' });
@@ -186,13 +187,6 @@ AuthenticationDialog.prototype = {
         this._session.connect('request', Lang.bind(this, this._onSessionRequest));
         this._session.connect('show-error', Lang.bind(this, this._onSessionShowError));
         this._session.connect('show-info', Lang.bind(this, this._onSessionShowInfo));
-
-        // Delay focus grab to avoid ModalDialog stealing focus with
-        // its buttons
-        this.connect('opened',
-                     Lang.bind(this, function() {
-                         this._passwordEntry.grab_key_focus();
-                     }));
     },
 
     startAuthentication: function() {